{include file="common/header"}

    <body>
        <div class="layui-fluid">
            <div class="layui-row">
                <form method="post" class="layui-form" action="">
                    <div class="layui-form-item">
                        <label class="layui-form-label">父级</label>
                        <div class="layui-input-block">
                            <select name="pid" lay-filter="aihao">
                                <option value="0">一级菜单</option>
                                {notempty name="glist"}
                                    {volist name="glist" id="vo"}
                                        <option value="{$vo.id}" {notempty name="$info"} {if condition="$info.pid eq $vo.id"} selected{/if} {/notempty} > {$vo.title}</option>
                                            {notempty name="$vo.children"}
                                                {volist name="vo.children" id="svo"}
                                                    <option value="{$svo.id}"  {notempty name="$info"}{if condition="$info.pid eq $svo.id"} selected{/if}{/notempty} >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|- {$svo.title}</option>
                                                        {notempty name="$svo.children"}
                                                            {volist name="svo.children" id="ssvo"}
                                                                <option value="" disabled {notempty name="$info"}{if condition="$info.pid eq $ssvo.id"} selected{/if}{/notempty} >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;┗ {$ssvo.title}</option>
                                                            {/volist}
                                                        {/notempty}
                                                {/volist}
                                            {/notempty}
                                    {/volist}
                                {/notempty}
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label  class="layui-form-label">
                            <span class="x-red">*</span>标题</label>
                        <div class="layui-input-block">
                            <input type="text"  name="title" required="" value="{$info.title|default=''}" lay-verify="text"  autocomplete="off" class="layui-input" placeholder="菜单标题">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            规则</label>
                        <div class="layui-input-block">
                            <input type="text"  name="route" required="" value="{$info.route|default=''}"   autocomplete="off" class="layui-input" placeholder="admin/控制器/方法，普通节点该栏不填">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label  class="layui-form-label">
                            <span class="x-red">*</span>图标</label>
                        <div class="layui-input-block">
                            <input type="text"  id="icon" name="icon" required="" value="{$info.icon|default=''}"  lay-verify="text"  autocomplete="off" class="layui-input" style="width:40%;float: left; ;">
                            <button type="button" class="layui-btn layui-btn-normal" onclick="openIcon()" style="float: left" >选择图标</button>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label  class="layui-form-label">排序</label>
                        <div class="layui-input-inline">
                            <input type="text"  name="weigh" required="" value="{$info.weigh|default=0}"   autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label  class="layui-form-label">
                            <span class="x-red">*</span>备注</label>
                        <div class="layui-input-block">
                            <textarea placeholder="请输入内容" class="layui-textarea" name="remark">{$info.remark|default=''}</textarea>
                        </div>
                    </div>
                    <div class="layui-form-item"></div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            菜单状态</label>
                        <div class="layui-input-inline">
                            <select name="type" lay-filter="aihao">
                                {notempty name="$info"}
                                    <option value="menu" {if condition="$info.type eq 'menu'"} selected{/if} >作为菜单</option>
                                    <option value="file" {if condition="$info.type eq 'file'"} selected{/if}>作为普通节点</option>
                                {else/}
                                    <option value="menu">作为菜单</option>
                                    <option value="file" >作为普通节点</option>
                                    {/notempty}
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <input type="hidden" value="{$info.id|default=''}" name="id">
                        <label for="L_repass" class="layui-form-label"></label>
                        <button class="layui-btn" type="submit" lay-filter="sub" lay-submit="">提交</button>
                    </div>
                </form>
            </div>
        </div>
    </body>
</html>
<script>
    function openIcon(){
        layer.open({
            type: 2,
            content: 'icon',
            title:"选择图标",
            area:["500px","400px"],
        });
    }
</script>